#include<stdio.h>
#include<ctype.h>
void expand(char [],char []);
int main() /* expanding shorthand notations */  
{
  char s1[100],s2[200];
  printf("enter a short hand notation string");
  fgets(s1,100,stdin);
  expand(s1,s2);
  printf("the expanded notation : ");
  puts(s2);
  return 0;
}

void expand(char s1[],char s2[])
{
  int i=0,k,j=0;
  while(s1[i]!='\0')
    { 
      if(s1[i]!='-')
        {
         s2[j++]=s1[i++];
         continue;
        }
     if(isspace(s1[i-1]) || isspace(s1[i+1]))
       {
         s2[j++]=s1[i];
       }
     else 
       {
         j--;
         for(k=s1[i-1];k<s1[i+1];k++)
            {
              s2[j++]=(char)k;
            }
       }

      i++;   
    }
      s2[j]='\0';
}
